package com.neutech.neureg.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neutech.neureg.service.PatientCostsService;
import com.neutech.vo.ViewObject;

@RestController
@RequestMapping("/reg/patientCosts")
public class PatientCostsController {
	@Autowired
	private PatientCostsService patientCostsService;
	/**
	 * 点击挂号时，同时获取患者费用数据
	 * @param patientCosts
	 * @return:resul--1时，status为200，添加患者费用明细成功；否则，status为403，添加失败
	 */
	@RequestMapping("/toAddPatientCosts")
	public ViewObject insertIntoPatientCosts(Map<String,Object> patientCosts){
		int result = patientCostsService.insertIntoPatientCosts(patientCosts);
		if(result == 1){
			return new ViewObject("200","success");
		}else{
			return new ViewObject("403","failure");
		}
	}
}
